<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of UserMenu
 *
 * @author Lawrence
 */
Yii::import('application.modules.admin.models.Menu');

class UserMenu extends CWidget{
   
    
    public $items = array('');

    public function run() {
//        $this->items = Util::app()->cache->get('AdminMenu_' . Util::user()->id);
        $this->items = false;
        if ($this->items === false) {
            $items = Menu::model()->findAll('type_id=:type_id && parent_id=0 && status=1', array(':type_id' => 3));
            foreach ($items as $item)
                $this->items[] = $item->getList();

//            Util::app()->cache->set('AdminMenu_' . Util::user()->id, $this->items, ConfigUtil::get('cache', 'time'));
        }

        $this->render('UserMenu', array('items' => $this->items));
    }

}

?>
